<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/calender/WdatePicker.js"></script>
<script type="text/javascript">
function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled!=true)
       e.checked = form.chkAll.checked;
    }
}
function check(){
	if (document.form1.title.value.match(/^\s*$/)){
		alert ("请输入优惠券名称");
		document.form1.title.focus();
		return false;
	}
	if (document.form1.startdate.value.match(/^\s*$/)){
		alert ("请输入起始日期");
		document.form1.startdate.focus();
		return false;
	}
	if (document.form1.enddate.value.match(/^\s*$/)){
		alert ("请输入结束日期");
		document.form1.enddate.focus();
		return false;
	}
}
</script>
</head>

<body>
<div id="spacemenu"></div>
<div class="alterdiv"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="38%" align="center" valign="top">
    	<div id="leftdiv">
        	<div id="titlediv">添加优惠券</div>
            <div id="formdiv">
            <form name="form1" id="form1" method="post" action="__URL__/add" onsubmit="return check()">
            	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="green" style="margin-top:40px;">
  <tr>
    <td width="33%" height="40" align="right">优惠券名称：</td>
    <td width="67%"><input type="text" name="title" id="title" class="htinputcss" /></td>
  </tr>
  <tr>
    <td height="40" align="right">金额：</td>
    <td><input type="text" name="price" id="price" class="htinputcss" value="0" style="width:50px;" /> 元</td>
  </tr>
  <tr>
    <td height="40" align="right">起始日期：</td>
    <td><input type="text" name="startdate" id="startdate" class="htinputcss" style="width:80px;" onClick="WdatePicker()" /> </td>
  </tr>
  <tr>
    <td height="40" align="right">结束日期：</td>
    <td><input type="text" name="enddate" id="enddate" class="htinputcss" style="width:80px;" onClick="WdatePicker()" /> </td>
  </tr>
  <tr>
    <td height="40">&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" class="addbtn" />&nbsp;&nbsp;
      <input type="reset" name="button2" id="button2" value="重置" class="resbtn" /></td>
  </tr>
</table>
</form>
            </div>
        </div>
    </td>
    <td width="62%" valign="top">
    	<div id="ldiv_search"></div>
        <div id="lnk_listdiv">
        <form name="form2" id="form2" method="post" action="__URL__/del">
        	<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e2e2e2" class="backfont">
  <tr bgcolor="#f7f7f7">
    <td width="10%" height="28" align="center"><input type="checkbox" onclick="CheckAll(this.form)" name="chkAll" value="checkbox" /></td>
    <td width="20%" align="center">名称</td>
    <td width="10%" align="center">金额</td>
    <td width="18%" align="center">日期</td>
    <td width="10%" align="center">排序</td>
    <td width="11%" align="center">管理</td>
  </tr>
<volist name="datalist" id="vo">
  <tr bgcolor="#FFFFFF" onmouseover="this.style.backgroundColor='#f7f7f7'" onmouseout="this.style.background='#FFFFFF'">
    <td height="52" align="center"><input type="checkbox" name="del[]" value="{?$vo.id?}" /></td>
    <td align="center">{?$vo.title?}</td>
    <td align="center">{?$vo.price?}</td>
    <td align="center">{?$vo['startdate']?}/{?$vo['enddate']?}</td>
    <td align="center"><input name="num[]" type="text" id="num[]" class="htinputcss" style="width:50px;" size="5" value="{?$vo.num?}" />
  <input name="numid[]" type="hidden" id="numid[]"  value="{?$vo.id?}" /></td>
    <td align="center"><a href="__URL__/edit?id={?$vo.id?}&page={?$page?} " class="edit">修改</a></td>
  </tr>
</volist>
  <tr bgcolor="#FFFFFF">
    <td height="52" colspan="6" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="delbtn" id="delbtn" class="delbtn" value="删除" onclick="return confirm('确认要删除吗？')" />&nbsp;&nbsp;
      <input type="button" name="button4" id="button4" class="orderbtn" value="修改排序" onClick="this.form.action='__URL__/order';this.form.submit()" onFocus="this.blur()" /></td>
    </tr>
</table>
</form>
        </div>
        <div id="pagediv">
        	{?$getpage?}
        </div>
    </td>
  </tr>
</table>
</body>
</html>
